class Solution {
    public int missingNumber(int[] nums) {
        int len = nums.length ;
        int sum = 0 ;
        for(int i: nums){
            sum += i;
        }
        int n = (1+len)*len/2 - sum ;
        return n ;
    }
}